import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WfContactVO, WfContactForm, WfContactQuery } from '@/api/biz/wfContact/types';

/**
 * 查询野火通讯录列表
 * @param query
 * @returns {*}
 */

export const listWfContact = (query?: WfContactQuery): AxiosPromise<WfContactVO[]> => {
  return request({
    url: '/biz/wfContact/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询野火通讯录详细
 * @param id
 */
export const getWfContact = (id: string | number): AxiosPromise<WfContactVO> => {
  return request({
    url: '/biz/wfContact/' + id,
    method: 'get'
  });
};

/**
 * 新增野火通讯录
 * @param data
 */
export const addWfContact = (data: WfContactForm) => {
  return request({
    url: '/biz/wfContact',
    method: 'post',
    data: data
  });
};

/**
 * 修改野火通讯录
 * @param data
 */
export const updateWfContact = (data: WfContactForm) => {
  return request({
    url: '/biz/wfContact',
    method: 'put',
    data: data
  });
};

/**
 * 删除野火通讯录
 * @param id
 */
export const delWfContact = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/wfContact/' + id,
    method: 'delete'
  });
};
